﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class UIPlayerUnits : MonoBehaviour {

	public Button sqr1;
	public Button sqr2;
	public Button sqr3;

	private Button[] btnUnits;
	public PlayerForces playerForce;

	// Use this for initialization
	void Start () {
		btnUnits = new Button[3];

		btnUnits [0] = sqr1;
		btnUnits [1] = sqr2;
		btnUnits [2] = sqr3;

		playerForce.evtUIHandlerMsg += OnUIMessage;
	}
	
	// Update is called once per frame
	void Update () {

	}

	void OnUIMessage(object sender, UIPlayerMessage msg)
	{
		if (msg.playerAct == EUIAction.eSelSquare)
		{
			int selId = playerForce.CurSelSquare.GetComponent<Camp>().squareID;

			//btnUnits [selId].Select ();
		}
	}
}
